package io.renren.core.config;

import com.baidu.aip.ocr.AipOcr;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: hongyuliu
 * @Date: 2020-07-29
 * @Version 1.0
 */
@Configuration
public class BaiduApiConfig {

    /**
     * API_ID
     */
    private static final String API_ID = "21577371";

    /**
     * key
     */
    private static final String API_KEY = "NqBGZ8OoZkxT2iBadGVu2WIf";

    /**
     * secret
     */
    private static final String SECRET_KEY = "dBhFMfKj9s7BwXwZjN3bPi3j6giZ0WzZ";

    @Bean
    public AipOcr getBaiduApiOcr(){
        AipOcr client = new AipOcr(API_ID, API_KEY, SECRET_KEY);
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);
        return client;
    }
}
